//控制比例大小
(function() {
	var b = document.documentElement,
		a = function() {
			var a = b.getBoundingClientRect().width;
			b.style.fontSize = 0.0625 * (750 <= a ? 750 : a) + "px"
		},
		c = null;
	window.addEventListener("resize", function() {
		clearTimeout(c);
		c = setTimeout(a, 300)
	});
	a()
})();
//全景看房
function view(e) {
	var href = $(e).next('a').attr('href');
	if (href) {
		layer.open({
			title: false,
			type: 2,
			shade: 1,
			area: ['92%', '90%'],
			zIndex: '18981111',
			content: [href, 'no'],
		});
	} else {
		layer.msg('暂无全景看房');
	}
}
//图片浏览
function clickP(e) {
	$('.picture ul li').removeClass('current');
	$(e).addClass('current');
}
//点赞
function thumb(e) {
	if ($(e).find('i').hasClass('active')) {
		$(e).find('i').removeClass('active');
	} else {
		$(e).find('i').addClass('active');
	}
}
//剩余字数
function words_deal(num) {
	var curLength = $("#TextArea1").val().length;
	if (curLength > num) {
		var num = $("#TextArea1").val().substr(0, num);
		$("#TextArea1").val(num);
	} else {
		$("#textCount").text(num - $("#TextArea1").val().length);
	}
}
//点击删除
function del(e) {
	var loadI;
	layer.confirm('确定删除吗？', {
			title: false,
			btn: ['确定', '取消'], //按钮
			yes: function(index) {
				layer.close(index);
				loadI = layer.load(2, {
					time: 2000
				});
			}
		})
		//关闭  
	layer.close(loadI);
}
